﻿using System.Web.Mvc;

namespace Facebook.Web.Mvc
{
    /// <summary>
    /// Simple Initialization Action Filter for a Facebook IFRAME MVC Application
    /// </summary>
    public class InitializeIframeActionAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (filterContext.ActionParameters.ContainsKey("facebookAPI"))
                filterContext.ActionParameters["facebookAPI"] = new Settings().GetFacebookAPI(filterContext, Settings.CanvasTypes.IFRAME);
        }
    }
}
